<?php

require "include/bittorrent.php";
dbconn();
loggedinorreturn();
$HTMLOUT = "";
$HTMLOUT .="<a href='bet.php'><img src='betting.png' alt='Bet' title='博彩' width='400' height='125' /></a>
<h1>博彩频道</h1>
<table class='main' cellspacing='0' cellpadding='5' border='0'>
<tr>
<td align='center' class='navigation'><a href='bet.php'>当前竞猜</a></td>
<td align='center' class='navigation'><a href='bet_old.php'>闭盘竞猜</a></td>
<td align='center' class='navigation'><a href='bet_coupon.php'>我的押注</a></td>
<td align='center' class='navigation'><a href='bet_bonustop.php'>用户排名</font></a></td>
<td align='center' class='navigation'><a href='bet_info.php'>系统帮助</a></td>
</tr>
</table>
<br />";
if (isset($_GET['showgames'])) {
	$gameid = $_GET['showgames'];
	$total = 0;
	$totalbonus = 0;
	$a = sql_query("SELECT * FROM bets LEFT JOIN betoptions ON optionid = betoptions.id WHERE  bets.gameid =" . sqlesc($gameid) . " ORDER BY date DESC") or sqlerr(__FILE__, __LINE__);
	$HTMLOUT .="<table cellpadding='2'>
<tr>
<td class='colhead'>时间</td>
<td class='colhead'>用户</td>
<td class='colhead'>选项</td>
<td class='colhead'>金额</td></tr>";
	while ($b = mysql_fetch_array($a)) {
		$HTMLOUT .="<tr><td>" . date("Y-m-d H:i:s", $b['date']) . "</td>";
		$HTMLOUT .="<td>" . get_username($b['userid']) . "</td>";
		$HTMLOUT .="<td>" . htmlspecialchars($b['text']) . "</td>";
		$HTMLOUT .="<td>" . htmlspecialchars($b['bonus']) . "</td></tr>";
		$total++;
		$totalbonus += $b['bonus'];
	}
	$HTMLOUT .="</table>";
}
stdhead('博彩');
print $HTMLOUT;
stdfoot();
